<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        while (true) {
            let num = +prompt(`你好我是小娜,你可以选择以下功能
            1，求和
            2，求积
            3，退出
            `)
            switch (num) {
                case 1:
                    let sum = 0
                    while (true) {

                        let num1 = +prompt(`请输入要求和的数据并按enter键结束`)

                        if (Boolean(num1) === false) {
                            break
                        }
                        sum += num1
                    }
                    alert(`以上输入数的和为${sum}`)
                    break
                case 2:
                    let product = 1
                    while (true) {

                        let num1 = +prompt(`请输入要求和的数据并按enter键结束`)

                        if (Boolean(num1) === false) {
                            break
                        }
                        product *= num1
                    }
                    alert(`以上输入数的和为${product}`)
                    break
                case 3:
                    alert(`你不爱我了，哭哭`)
                    break
                default: alert(`您的输入有误请重新输入`)
                    break
            }
            if (num === 3) {
                break
            }
        }
    </script>
</body>

</html>